package com.ruoyi.instrumentation.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.instrumentation.mapper.InstrumentBookingMapper;
import com.ruoyi.instrumentation.domain.InstrumentBooking;
import com.ruoyi.instrumentation.service.IInstrumentBookingService;

/**
 * 仪器设备预约Service业务层处理
 * 
 * @author hj
 * @date 2025-01-13
 */
@Service
public class InstrumentBookingServiceImpl implements IInstrumentBookingService 
{
    @Autowired
    private InstrumentBookingMapper instrumentBookingMapper;

    /**
     * 查询仪器设备预约
     * 
     * @param bookingId 仪器设备预约主键
     * @return 仪器设备预约
     */
    @Override
    public InstrumentBooking selectInstrumentBookingByBookingId(Long bookingId)
    {
        return instrumentBookingMapper.selectInstrumentBookingByBookingId(bookingId);
    }

    /**
     * 查询仪器设备预约列表
     * 
     * @param instrumentBooking 仪器设备预约
     * @return 仪器设备预约
     */
    @Override
    public List<InstrumentBooking> selectInstrumentBookingList(InstrumentBooking instrumentBooking)
    {
        return instrumentBookingMapper.selectInstrumentBookingList(instrumentBooking);
    }

    /**
     * 新增仪器设备预约
     * 
     * @param instrumentBooking 仪器设备预约
     * @return 结果
     */
    @Override
    public int insertInstrumentBooking(InstrumentBooking instrumentBooking)
    {
        instrumentBooking.setCreateTime(DateUtils.getNowDate());
        return instrumentBookingMapper.insertInstrumentBooking(instrumentBooking);
    }

    /**
     * 修改仪器设备预约
     * 
     * @param instrumentBooking 仪器设备预约
     * @return 结果
     */
    @Override
    public int updateInstrumentBooking(InstrumentBooking instrumentBooking)
    {
        instrumentBooking.setUpdateTime(DateUtils.getNowDate());
        return instrumentBookingMapper.updateInstrumentBooking(instrumentBooking);
    }

    /**
     * 批量删除仪器设备预约
     * 
     * @param bookingIds 需要删除的仪器设备预约主键
     * @return 结果
     */
    @Override
    public int deleteInstrumentBookingByBookingIds(Long[] bookingIds)
    {
        return instrumentBookingMapper.deleteInstrumentBookingByBookingIds(bookingIds);
    }

    /**
     * 删除仪器设备预约信息
     * 
     * @param bookingId 仪器设备预约主键
     * @return 结果
     */
    @Override
    public int deleteInstrumentBookingByBookingId(Long bookingId)
    {
        return instrumentBookingMapper.deleteInstrumentBookingByBookingId(bookingId);
    }

    /**
     * 假删
     * @param params
     * @return
     */
    @Override
    public int updateInstrumentBookingByBookingId(Map<String, Object> params) {
        return instrumentBookingMapper.updateInstrumentBookingByBookingId(params);
    }

    /**
     * 批量假删
     * @param params
     * @return
     */
    @Override
    public int updateInstrumentBookingByBookingIds(Map<String, Object> params) {
        return instrumentBookingMapper.updateInstrumentBookingByBookingIds(params);
    }
}
